const api = require('../../utils/api.js')
const app = getApp()

Page({
  data: {
    sans: []
  },
  onLoad: function(options) {
    this.setData({store: options.store})
    this.loadingMore()
  },
  loadingMore(e) {
    var page = this.data.page ? (this.data.page + 1) : 1;
    api.getData(`/chart/view/main/107_${page}.json?store=`+this.data.store).then(res => {
      this.setData({
        page: page,
        sans: this.data.sans.concat(res.rows)
      });
      // 将列表数据缓存到全局变量，详情页直接取出对应的记录
      app.globalData.sans = this.data.sans;
    }).catch(() => {});
  },


})